//
//  MyCardView.m
//  缩小轮播
//
//  Created by Playboy on 2017/7/26.
//  Copyright © 2017年 tmkj. All rights reserved.
//

#import "MyCardView.h"

@interface MyCardView ()

@property (nonatomic, strong) UIImageView *imageView;

@end

@implementation MyCardView

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        [self initView];
    }
    return self;
}

-(void)initView {
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    imageView.layer.cornerRadius = 5.0f;
    imageView.layer.masksToBounds = YES;
    [self addSubview:imageView];
    self.imageView = imageView;
}

- (void)refreshWithImageArray:(NSArray *)imageArray andIndex:(NSInteger)index{
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:imageArray[index]] placeholderImage:[UIImage imageNamed:@"scenic_placeholder"]];
}

@end
